
HAS_OPENCL = 

ifeq "$(shell uname -s)" "Darwin"
HAS_OPENCL = "Mac OS X"
LDFLAGS := $(LDFLAGS) -framework OpenCL
endif


########################################################################
#detect ATI
########################################################################

ifndef HAS_OPENCL
ifdef ATISTREAMSDKROOT
HAS_OPENCL = "ATI"
ifneq (64,$(findstring 64,$(shell uname -m)))
OCL_ARCH :=x86#
else
OCL_ARCH :=x86_64# 
endif
CFLAGS   := $(CFLAGS)  -I'$(ATISTREAMSDKROOT)'include
LDFLAGS  := $(LDFLAGS) -L'$(ATISTREAMSDKROOT)'lib/$(OCL_ARCH) -lOpenCL 
endif
endif

ifndef HAS_OPENCL
ifdef CUDA_INC_PATH
HAS_OPENCL = "CUDA"
CFLAGS   := $(CFLAGS)  -I'$(CUDA_INC_PATH)'
LDFLAGS  := $(LDFLAGS) -L'$(CUDA_LIB_PATH)' -lOpenCL
endif
endif

ifndef HAS_OPENCL
ifdef CUDASDKROOT
HAS_OPENCL = "CUDA"
CFLAGS  := $(CFLAGS) -I'$(CUDASDKROOT)'include
LDFLAGS := $(LDFLAGS) -lOpenCL
endif
endif
